#include <cstdio>
#include <cstring>
bool hash[128] = {false};//*********************
int main()
{
    char str1[80], str2[80];
    char c;
    int i = 0;
    while ((c = getchar()) != '\n')
    { //读取字符，同时把小写字母转换成大写
        if (c >= 'a' && c <= 'z')
            c -= 32;
        str1[i++] = c;
    }
    str1[i] = 0;
    i = 0;
    while ((c = getchar()) != '\n')
    { //读取字符，同时把小写字母转换成大写
        if (c >= 'a' && c <= 'z')
            c -= 32;
        str2[i++] = c;
    }
    str2[i] = 0;
    int len = strlen(str2);
    for (i = 0; i < len; ++i)
    { //遍历输出字符串，统计个字符是否出现过
        hash[str2[i]] = true;
    }
    len = strlen(str1);
    for (i = 0; i < len; ++i)
    {
        if (false == hash[str1[i]])
        {
            putchar(str1[i]);
            hash[str1[i]] = true;
        }
    }
    putchar('\n');
    return 0;
}